#include <iostream>
#include <vector>
#include <queue>

using namespace std;

// 2200. 找出数组中的所有 K 近邻下标
// https://leetcode.cn/problems/find-all-k-distant-indices-in-an-array/description/?envType=daily-question&envId=2025-06-24

class Solution {
public:
    vector<int> findKDistantIndices(vector<int>& nums, int key, int k) {
        vector<int> ans;
        int cur = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            if(nums[i] == key){
                cur = max(i - k, cur);
                for (cur; cur <= i + k && cur < nums.size(); cur++){
                    ans.push_back(cur);
                }
            }
        }
        return ans;
    }
};

int main()
{
    return 0;
}